<?php

/**
 * Interface where we declare all required function for the Babili User System
*/

interface BabiliUsersInterface
{
	/**
	 * Function that says if a user is logged or not
	 * @return bool
	 */
	public function babili_user_is_logged_in();
	
	/**
	 * Function that returns the id of the current user
	 * @return int the user id
	 */
	public function babili_user_get_id();
	
	/**
	 * Function which have to give us information about the user (userid, username, email)
	 * @param $userid the id of the user
	 * @return array $user = array('username' => $USERNAME, 'userid' => $USERID, 'email' => $USERMAIL)
	 */
	public function babili_user_get($userid);
	
	/**
	 * Give all Babili users
	 * @return array $users = array($USERID => array('username' => $USERNAME, 'userid' => $USERID, 'email' => $USERMAIL),
	 * 								$USERID2 => array('username' => $USERNAME2, 'userid' => $USERID2, 'email' => $USERMAIL2),
	 * 								...)
	 */
	public function babili_user_get_all();
	
	/**
	 * Display or send to the login form
	 * @return the display of the login form or redirect to it
	 */
	public function babili_user_login_form();
	
	/**
	 * Logout the user
	 * @return or redirect to the logout page
	 */
	public function babili_user_logout();
	
	/**
	 * Display the search form of users
	 * @return the html display of the search form
	 */
	public function babili_user_search_form();
	
	/**
	 * Return an array of users, results of the search
	 * @param array of search paramaters (username, email...)
	 * @return array $users = array($USERID => array('username' => $USERNAME, 'userid' => $USERID, 'email' => $USERMAIL),
	 * 								$USERID2 => array('username' => $USERNAME2, 'userid' => $USERID2, 'email' => $USERMAIL2),
	 * 								...)
	 */
	public function babili_user_search_result($params = array());
}